/**
 * 样式top,right自适功能
 * @namespace bs.posfixe样式自适功能
 */
;bs.posfix = function (domid, options, callback) {

    var deferred = when.defer();
    if($.fn.domFixed){
        __posfix(domid, options, callback, deferred);
    }else{
        var d = bs.using.base + 'ui/'
        var m ={
           js:d + 'jquery.pos-fixed.js'
        }
        bs.using.modules.posFixed = m;
        bs.using.load('posFixed',function(){
            __posfix(domid, options, callback, deferred);
        });
    }

    function __posfix(domid, options, callback, deferred){
        var me = this;
        $(domid).domFixed(options);
        deferred.resolve();
        if (bs.util.isFunction(callback)) {
            callback.call(me);
        }
    }
    return deferred.promise;
}